package com.example.module.goods.controller;


import cn.dev33.satoken.annotation.SaCheckLogin;
import com.example.common.base.MyResult;
import com.example.module.goods.form.GoodsUpdateForm;
import com.example.module.goods.service.GoodsImagesService;
import com.example.module.goods.service.GoodsService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author ghy
 * @date 2025/09/18
 * @description 商品图片控制层
 */
@Validated
@RestController
@RequestMapping("/goods/images")
public class GoodsImagesController {
    @Resource
    private GoodsImagesService goodsImagesService;

    /*
     * 上传图片至minio
     *
     * @param file              上传的图片文件
     * @return fileUrl          图片URL
     * */
    @PostMapping("/upload")
    @SaCheckLogin
    public String uploadFile(@RequestParam MultipartFile file) {
            return goodsImagesService.uploadFile(file);
    }
}
